/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import com.sun.xml.internal.ws.message.saaj.SAAJHeader;
import java.io.*;
import java.net.*;
import javax.swing.*;

/**
 *
 * @author Reynald
 */
public class SocketClient {
    Socket socket = null;
    PrintWriter out = null;
    BufferedReader in = null;
    String username;
    String password;
    JFrame fr = new JFrame();
    JButton connect = new JButton();
    JButton disconnect = new JButton();
    JTextField un = new JTextField();
    JTextField pass = new JTextField();
    
    SocketClient(){
        
    }
    
    public void listenSocket(){
        try{
            socket = new Socket("127.0.0.1", 1235);
            out = new PrintWriter(socket.getOutputStream(), true);
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        }catch(Exception e){
            
        }
    }
    
    public static void main(String[] args){
        SocketClient clt = new SocketClient();
        String input;
        clt.listenSocket();
        int i = 0;
        clt.username = "adriano";
        clt.password = "doremi";
        clt.out.println(clt.username);
        clt.out.println(clt.password);
        try{
            input = clt.in.readLine();
            System.out.println(input);
        }catch(Exception e){
            System.out.println("FAILED!");
            System.exit(1);
        }
    }
}
